import $http from "util/https/index.js"
const upData = (data) => {
	

	let {
		pack,
		brand,
		version,
		imei,
		oaid,
		property_id,
		event,
		uid,
		order_id
	} = data
	let params = {
		app: {
			pack: pack,
			os: "android",
			brand: brand,
			version: version
		},
		device: {
			imei: imei,
			oaid: oaid
		},
		uid: uid,
		extends: {
			order_id: order_id ? order_id : null
		},
		property_id: property_id,
		event: event,
	}

	console.log(params)
	return new Promise((resolve, reject) => {
		$http2.post("api/oppo/eventUp", params).then(res => {
			if (res.code == 0) {
				console.log("上报成功")
				resolve(res)
			} else {
				reject(res)
			}
		})
	})


}


export {
	updataEvent
}